package com.siemens.exercise;
import java.util.ArrayList;

//add
public class AddExecute implements Command{
	
	@Override
	public int calc(String s) throws NegtiveNumException {
			
		int result=0;
		ArrayList<Integer> num = StringFilter.getNumbers(s);
		for (Integer i : num) {
			result += i;
		}
		return result;		
	}
}